package com.ssl.ware.controller;

import com.ssl.ware.pojo.OderPageRequest;
import com.ssl.ware.service.WarehouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 仓储服务
 */
@RestController
@RequestMapping("/ware")
public class WareHouseController {
    @Autowired
    private WarehouseService warehouseService;

    /**
     * 计算运费
     * @param oderPageRequests
     * @return
     */
    @RequestMapping("/calculateFreight")
    public Integer calculateFreight(@RequestBody List<OderPageRequest> oderPageRequests) {
        return warehouseService.calculateFreight(oderPageRequests);
    }
}
